package lambda;
/*
    Lambda表达式:
        简介：函数式接口的实现方式
 */

public class LambdaDemo {
    public static void main(String[] args) {
        NOAny noAny = () -> System.out.println("无参数，无返回值");
        noAny.show();

        NOreturn1 noReturn1 = a -> System.out.println("单参数，无返回值");
        noReturn1.show(1);

        NOreturn2 noReturn2 = (a,b) -> System.out.println("多参数，无返回值");
        noReturn2.show(1,2);

        YESreturn1 yesReturn1 = () -> 1;// 无参数，有返回值
        System.out.println(yesReturn1.show());
        YESreturn2 yesReturn2 = a -> a;// 单参数，有返回值
        System.out.println(yesReturn2.show(1));
        YESreturn3 yesReturn3 = (a,b) -> a+b;// 多参数，有返回值
        System.out.println(yesReturn3.show(1,2));

    }
}
